<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__PUBLIC__/admin/sncss/css/style.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/sncss/css/combo.select.css" rel="stylesheet" type="text/css" />
</head>

<body>
<a name="top"id="top"></a>
	<div class="place">
	<span>位置：</span>
	<ul class="placeul">
	<li><a>首页</a></li>
	<li><a>订单管理</a></li>
	<li><a>订单详情</a></li>
	<li><a onClick="javascript:history.back(-1);">返回</a></li>
	</ul>
	</div>

	<div class="formbody">

	<div class="formtitle"><span>订单详情</span></div>
	<ul class="forminfo">
	<?php if(!empty($orderdata['audio_link'])){?>
	<li><label>交付的音频</label>
	<label><audio src="<?php echo $orderdata['audio_link'];?>" controls="controls">您的浏览器不支持 audio 标签。</audio></label><i></i>
	<div id="videoWrap"></div>
	</li>
	<li><label>交付时间</label>
	<label style="width: 800px;"><?php echo date("Y-m-d H:i:s",$orderdata['audio_upload_time']);?></label>
	</li>
	<?php }?>
	<li>
	<!-- <label>主播编号</label>
	<label>{$orderdata['uuid']}</label>
	</li>
	<li>
	<label>主播昵称</label>
	<label>{$orderdata['nickname']}</label>
	</li>
	<li>
	<label>主播手机号</label>
	<label>{$orderdata['username']}</label>
	</li> -->
	<?php if($orderdata['type']==4){?>
	<li>
	<label>自媒体</label>
	<label><?php echo $orderdata['media_name'];?></label>
	</li>
	<?php }?>

	<li>
	<label>类型</label>
	<label>
		<switch name="orderdata['category']" >
		<case value="1">评述讲解</case>
		<case value="2">情感演绎</case>
		<case value="3">娱乐互动</case>
		<case value="4">新闻播报</case>
		<case value="5">英文播报</case>
		<default />未知
		</switch>
	</label>
	</li>
	<li>
	<label>性别</label>
	<label><switch name="orderdata['sex']" >
		<case value="1">男</case>
		<case value="2">女</case>
		<default />全部
		</switch>
	</label>
	</li>
	<li><label>标题</label>
	<label style="width: 800px; font-size: 16px;">{$orderdata['title']}</label>
	</li>

	<li><label>文章</label>
	<textarea style="float: left;" name="article" id="article" readonly>{$articledata}</textarea><i></i>
	</li>
	<li>
	<label>总字数</label>
	<label>{$orderdata['words']}个</label>
	</li>
	<?php if($orderdata['type']==4&&empty($orderdata['audio_link'])){?>
	<li>
	<audio src="" id='ad-bgm' controls="controls">您的浏览器不支持 audio 标签。</audio>
	<div id="container_bgm" style="float: left;">
		<a class="btn" id="pickfiles_bgm" style="display: block; text-align: center;line-height: 36px;" ><span id="updata_more_audio_finish_bgm">选择文件</span></a>
	</div>
	<input id="audio_mp3" type="hidden" value="" name="audio_mp3" />
	<br>
	<br>
	<input type="button" id="submit_order" class="btn" value="提交"/></li>
	</li>
	<?php }?>
	<?php if($orderdata['type']==3&&!empty($orderdata['audio_link'])&&$orderdata['scoretype'] == 0){?>
	<li>
		<a href="/Home/Sendorder/check_success?oid=<?php echo $orderdata['id'];?>&p=<?php echo $p;?>" class="btn" style="display: block; text-align: center;line-height: 36px; float: left; margin-right: 10px;" onclick="if(confirm('确认抽审通过吗')==false)return false;">抽审通过</a>
		<input type="button" class="btn" style="float: left;" href="javascript:void(0);" id="inside" value="抽审不合格"/>
	</li>
	<?php }?>

	</ul>

	</div>
<br><br><br><br>
</body>
<script src="__PUBLIC__/admin/Js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
var editor = UE.getEditor('article',{    //content为要编辑的textarea的id
	initialFrameWidth: 800,   //初始化宽度
	initialFrameHeight: 200,   //初始化高度
	initialStyle:'p{line-height:2em}'
});
</script>
<!-- <script src="__PUBLIC__/js/jquery1.8.3.js"></script> -->
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript" src='__PUBLIC__/admin/Js/plupload.full.min.js'></script>
<!-- qiniu.js依赖于Plupload，所以Plupload要在qiniu.js之前引用 -->
<script type="text/javascript" src="__PUBLIC__/admin/Js/qiniu.js"></script>
<script type="text/javascript">
	//====================================================================================
	var ADMIN_URL = "<?php echo "http://".ADMIN_URL;?>"
	Qiniu.uploader({
			runtimes: 'html5,flash,html4',
			browse_button: 'pickfiles_bgm',
			// HTML中重要的div的ID
			container: 'container_bgm',
			drop_element: 'container_bgm',
			max_file_size: '100mb',
			dragdrop: true,
			chunk_size: '100mb',
			uptoken_url:'http://qiniu.heardtech.com/uptoken2.php',
			domain: 'http://audio.heardtech.com',
			get_new_uptoken: false,
			auto_start:true,
			log_level: 5,
			unique_names: true,
			save_key: false,
			multi_selection: false,  // 禁止同时上传多个文件
			init: {
				'FilesAdded': function(up, file) {
				},
				'BeforeUpload': function(up, file) {
				},
				'UploadProgress': function(up, file) {
					console.log(file.name, file.percent);
					$('#updata_more_audio_finish_bgm').text('正在上传（' + file.percent + '%）');
				},
				'UploadComplete': function(up,file) {
						// console.log("我是七牛",this);
				},
				'FileUploaded': function(up, file, info) {
					// console.log('文件上传完成后！');
					$('#updata_more_audio_finish_bgm').text('上传成功');
					var obj=$.parseJSON(info.response);
					var hash=obj.hash;
					var key=obj.key;
					var persistentId=obj.persistentId;
					$('#audio_mp3').val(key);
					$("#ad-bgm").attr('src',"http://audio.heardtech.com/"+key);
				},
				'Error': function(up, err, errTip) {
						$('#updata_more_audio_finish_bgm').text('上传失败');
				},
				'Key': function(up, file) {

				}
			},
			filters : {
				max_file_size : '100mb',
				mime_types: [
					{title : "Audio files", extensions : "mp3"}// 限定flv,mpg,mpeg,avi,wmv,mov,asf,rm,rmvb,mkv,m4v,mp4后缀格式上传
				]
			}
	});

//=====================================================================================================================================
</script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('#submit_order').click(function(){
			var oid = <?php echo $orderdata['id'];?>;
			var sex = <?php echo $orderdata['sex'];?>;
			var article_id = "<?php echo $orderdata['article_id'];?>";
			var audio_mp3 = $('#audio_mp3').val();
			if(audio_mp3.length == 0){
				layer.msg('请上传音频');return false;
			}
			$.post("/Home/Sendorder/TengxunJson",{audio_mp3:audio_mp3,sex:sex,oid:oid,article_id:article_id},function(data){
				if (data.code == '000000') {
					alert(data.message);
					// window.history.back(-1);
					window.location.href="/Home/Sendorder/sendorder_list";
				} else {
					alert(data.message);
				}
			},'json');
		});
	});
</script>
<script type="text/javascript">
$("#inside").click(function(){
		layer.open({title: false, type: 1, area: ['600px', '300px'], //宽高
				content: '<div style="padding:10px;"><form id="form2" name="form2" method="post" action="/Home/Sendorder/check_fail" onsubmit="return form2_submit();">'
				+'<textarea class="textinput" name="fail_message" id="fail_message"></textarea>'
				+'<input name="oid"  type="hidden" class="dfinput" value="{$orderdata[id]}" />'
				+'<input name="p"  type="hidden" class="dfinput" value="{$p}" />'
				+'<input name="submit_type" type="submit" class="btn" value="提交"/></form></div>'
		});
});
</script>
<script type="text/javascript">

		function form2_submit(){
				var fail_message= $('#fail_message').val();
				if(fail_message.length==0){
						layer.msg('必须填写理由');return false;
						// alert('必须填写理由');return false;
				}
		}
</script>

</html>
